<?php if(!defined('A')) exit;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站内容管理系统</title>
<?php
loadcss(array('reset','shell'));
loadcss(array('smart_pager','colorbox','glDatePicker'),P_CSS);
loadjs(array('jquery','smart_pager','jquery.colorbox','glDatePicker'),P_JS);
loadjs(array('tab','util','table'));
?>
<script type="text/javascript">
$(document).ready(function(e) {
var smallNowTab;
var pt = new Tabs();
pt.classpre="smalltab_";
pt.container = "smalltab_container";
pt.createTab("t1","会员账号列表","",true,"n");
pt.init = function(){
	smallNowTab = pt.nowTab;
};
pt.onclick = function(){
	smallNowTab = pt.nowTab;
};		
pt.initTab();
pt.clickNowTab();    

$(".example1").colorbox({width:"600px", height:"400px", iframe:true, opacity:0.3});


$('#reg_time_1').glDatePicker();
$('#reg_time_2').glDatePicker();
});

$(document).ready(function(){
	 //全选
     $("#CheckedAll").click(function(){
	     $("[name='items[]']:checkbox").attr('checked', true);
	 });
	 //全不选
     $("#CheckedNo").click(function(){
	    $("[name='items[]']:checkbox").attr('checked', false);
	 });
	 //反选
     $("#CheckedRev").click(function(){
		  $("[name='items[]']:checkbox").each(function(){
			this.checked=!this.checked;
		  });
	 });
	$('#myform').submit(function(){
		var l=$("[name='items[]']:checkbox:checked");
		if(l.length==0){
			alert('请选择一项！');
			$(this).get(0).reset();
			return false;
		}
		return true;
	});
	$('#op_1').click(function(){
		$('#myform').attr('action','<?php echo url('front_admin','bit_op','k=delete');?>');	
	});
	$('#tag').change(function(){
		if(parseInt($(this).val())>-1){
			$('#myform').attr('action','<?php echo url('front_admin','bit_op','k=update_status');?>');
			$('#myform').submit();	
		}
	});
	
});

</script>
<style>
body{margin:10px;}
</style>
</head>
<body>
<table class="settop">
<tr>
<td class="settop_left">
&nbsp;&nbsp;
</td>
<td>
<div id="smalltab_container"></div>
</td>
</tr>
</table>
<div class="smalltab_line"></div>
<div id="t1">
<br />
<br />
<form action="?" method="get">
<table width="100%" border="1" cellspacing="0" cellpadding="0" class="mytable">
  <tr>
    <td align="center">
    
    状态：
    <select name="tag" id="">
	<?php echo form_select($tag_data,$tag);?>
    </select>
    &nbsp;
    所属组：
    <select name="group_id" id="">
	<?php echo form_select($group_data,$group_id);?>
    </select>
    &nbsp;
    邮箱：<input name="email" type="text" class="input" value="<?php echo $email;?>" />
    <br />
	注册时间：<input name="reg_time_1" id="reg_time_1" type="text" class="input2" value="<?php echo $reg_time_1?>" />
    - <input name="reg_time_2" id="reg_time_2" type="text" class="input2" value="<?php echo $reg_time_2?>" />
    <br />
	ID:<input name="id" type="text" class="input2" value="" />
	账号：<input name="user_name" type="text" class="input" value="<?php echo $user_name;?>" />
<br />
<input name="submit" type="submit" class="color_btn color_btn_yellow" value="搜索" />
    </td>
  </tr>
</table>
</form>
<br />
<form id="myform" action="<?php echo url('front_admin','bit_op');?>" method="post">
<table width="90%" border="0" cellspacing="0" cellpadding="0" class="mytable">
<?php
if(!empty($return)){
?>
  <tr>
    <td align="center">&nbsp;</td>
    <td align="center">ID</td>
    <td align="center">所属组</td>
    <td align="center">账号</td>
    <td align="center">状态</td>
    <td align="center">编辑</td>
    <td align="center">删除</td>
  </tr>
<?php 
foreach($return[0] as $k=>$v){
?>
  <tr>
    <td align="center"><input type="checkbox" name="items[]" value="<?php echo $v['id']; ?>" /></td>
    <td align="center"><?php echo $v['id']; ?></td>
    <td align="center"><?php echo myswitch($v['group_id'],$group_data);?></td>
    <td align="center"><?php echo $v['user_name']; ?></td>
    <td align="center"><?php echo myswitch($v['tag'],array(1=>'正常',0=>'屏蔽')); ?></td>
    <td align="center"><a href="<?php echo url('front_admin','mod','id='.$v['id']);?>" class="example1"><img src="<?php echo PROJECT_IMG_URL;?>bianji.gif" alt="" /></a></td>
    <td align="center"><a href="<?php echo url('front_admin','del','id='.$v['id']);?>" onclick="return confirm('确定要删除么？');"><img src="<?php echo PROJECT_IMG_URL;?>shanchu.gif" alt="" /></a></td>
  </tr>
<?php
}
?>
  <tr>
    <td colspan="7" align="center"><?php echo $return[1];?></td>
    </tr>
  <tr>
  	<td colspan="7" align="center">
    <input type="button" id="CheckedAll" value="全　选"/>
    <input type="button" id="CheckedNo" value="全不选"/>
    <input type="button" id="CheckedRev" value="反　选"/> 
    <br />
    选中项 ：<input onclick="return confirm('确定要删除么？');" type="submit" id="op_1" value="删除"/>
    &nbsp;
    状态
    <select name="tag" id="tag">
    <?php echo form_select($tag_data,-1);?>
    </select>
    </td>
  </tr>
<?php
}else{
?>
  <tr>
    <td colspan="7" align="center">无内容！<a href="<?php echo url('front_admin','li');?>">返回列表</a></td>
    </tr>
<?php
}
?>
</table>
</form>
</div>
</body>
</html>